﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace TST.SharePointObjects
{
    internal class IndexSiteObjectList : SiteObjectList
    {
        internal IndexSiteObjectList(LicensingMode licensingMode, Guid farmID, SharePointObjectsDatabase database)
            : base(licensingMode, farmID, database)
        {
        }

        internal void LoadIndexObjects()
        {
            Clear();
            SiteObjectStore store = new SiteObjectStore(FarmID, Guid.Empty, Guid.Empty, FarmID, _database);
            DataTable table = store.GetIndexObjects();
            if (table != null)
            {
                foreach (DataRow row in table.Rows)
                {
                    SiteObject so = new SiteObject();
                    store.ReadDataRow(row, so);
                    Add(so);
                }
            }
        }

        protected override void doLoadFromWeb()
        {
        }

        protected override void doLoadFromWeb(string groupFilter, string nameSearch)
        {
        }

        public override SiteObjectType SiteObjectType
        {
            get { return SiteObjectType.All; }
        }

    }
}
